package com.preskool.service.impl;

import com.github.pagehelper.PageHelper;
import com.preskool.mapper.HolidayMapper;
import com.preskool.po.Holiday;
import com.preskool.service.HolidayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class HolidayServiceimpl implements HolidayService {

    @Autowired(required = false)
    private HolidayMapper holidayMapper;

    @Override
    public List<Holiday> findAll(Integer currentPage,Integer pageSize) {
        PageHelper.startPage(currentPage,pageSize);
        List<Holiday> all = holidayMapper.findAll();
        return all;
    }

    @Override
    public Holiday findOne(Integer hid) {
        Holiday one = holidayMapper.findOne(hid);


        return one;
    }

    @Override
        public Integer del(Integer hid) {
        Integer del = holidayMapper.del(hid);
        return del;
    }

    @Override
    public Integer update(Holiday holiday) {
        Integer update = holidayMapper.update(holiday);

        return update;
    }

    @Override
    public Integer add(Holiday holiday) {

        Integer add = holidayMapper.add(holiday);
        return add;
    }
}
